(function() {
  $('.cc-box-group .cc-box').on('click', function () {
    var type = $(this).attr('type-value');
    $.ajax({
      url: '/api/user/bindtype',
      method: 'post',
      data: {
            type:type
      },
      success: function (res) {
        switch (type) {
          case "1":
            location.assign('/admin/index.html')
            break;
          case "2":
            if(res.data === 'schedule'){
              location.assign('/teacher/index_m_s.html#timetable')
              break;
            }
            location.assign('/teacher/index_m.html#personInfo')
            break;
          case "3":
            if(res.data === 'schedule'){
              location.assign('/student/index_m_s.html#student_lessontimes')
              break;
            }
            location.assign('/student/index_m.html#student_personal_center')
            break;
        }
      }
    });

  })

}());